<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<title>deepseek接口调用验证</title>
<script type="text/javascript" src="/js/vue.js"></script>
<script type="text/javascript" src="/js/axios.min.js"></script>
<link href="/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>


<div id="app" class="container">
    <div class="row mt-4">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header">
                    <h4>富文本显示</h4>
                </div>
                <div class="card-body">
                    <div class="form-group">
                        <label for="richTextInput">输入富文本内容</label>
                        <textarea class="form-control" id="richTextInput" v-model="richText" rows="3"></textarea>
                    </div>
                    <button class="btn btn-primary" @click="showRichText">发起应答</button>

                    <div class="mt-4 p-3 border rounded bg-light" v-html="displayText"></div>
                </div>
            </div>
        </div>
    </div>
</div>


<script>

    var v = new Vue({
        el: "#app",
        data: {
            fsList:[],
            parentDir:"",
            currentDir:"",
            email:"",
            richText: '',
            displayText: ''
        },

        methods: {


            showRichText: function () {
                var vueObj = this;
                alert("发起请求："+vueObj.richText)
                //置空
                vueObj.displayText = "";

                //vueObj.displayText = vueObj.richText;
                 // 发起请求
                 axios.get("/deepseek/chat/api?askMsg="+vueObj.richText).then(function (resp) {
                  let code =  resp.data.code;
                  if(code == 0){
                      vueObj.displayText = resp.data.data;
                  }

                })
            }

        },


    })


</script>


</body>
</html>